#ifndef SYMBOL_H_
#define SYMBOL_H_
#include "Number.h"
/*Data type for symbols*/

/* The whole arithmetic expression is stored in a tree. Inner nodes are
 * functions and operators, leaves are numbers, constants and symbols.
 * There are (at least) two ways to represent the nodes. One is using classes
 * and inheritance (class Node and then derived classes for functions, etc),
 * using methods and maybe overloaded operators.
 * The second way is using "variant record". Standard way of doing this is
 * with struct containing union, however this cannot be don, if (for example)
 * we use some nontrivial kinds of numbers. Other solution is letting all
 * possible types in node (and to save some memory, use pointers).
 *
 * I decided to use second approach, because a) I am more familiar with C
 * than C++, b) I can see deeper to what the program is doing. The user will
 * not have to see how the SymCe works inside.
 */

namespace SymCe{
	enum SymbolType{NUMBER=0, FUNCTION, OPERATOR, VARIABLE, CONSTANT}; //Set variable has both name and value. It is sam as constant, but constant should not be changed.
	enum FunctionType{LN, SIN, COS, TAN}; //Will add more.
	enum OperatorType{PLUS, MULTIPLY, POWER};
	//typedef Fraction Number;

	/* This structure represents data stored in the tree*/
	struct Symbol{
		//Symbol needs to keep track what kind of data it is
		//and also actual data.
		SymbolType type;
		FunctionType func;
		OperatorType oper; //operator is keyword :-)
		//What kind of number should we use? Let's use Fractions
		Number number;
		char * name; //Of course, std::string can be used.
		bool operator==(const Symbol & symbol) const;
		bool operator<(const Symbol & symbol) const;
		Symbol & operator=(const Symbol & symbol);
		Symbol();
		Symbol(const Symbol & symbol);
		~Symbol();
	};
}


#endif /*SYMBOL_H_*/
